#ifndef RUNSHOPBEAN_H
#define RUNSHOPBEAN_H
#include "QString"
#include "citynode.h"
#include "QJsonObject"
#include "opencv2/opencv.hpp"
using namespace cv;

class RunShopBean
{
public:
    int num;//序号，和 角色管理中对应

    QString groupCity; //进入帮派城市
    QString groupCityEn; //进入帮派城市英文名称
//    int groupXiaoWeiLocationX; //校尉坐标
//    int groupXiaoWeiLocationY;

    QString groupXiaoWeiLocation = "";

    int groupLocationX = 148; //钱为一
    int groupLocationY = 56;

    int groupIndex; //帮派索引


    QString remoteCity; //远程跑商城市
    QString remoteCityEn; //远程跑商城市英文名称



    QString remoteXiaoWeiLocation = ""; //对方校尉坐标 如果为无，则表示是帮派之间

    int remoteLocationX = 0 ;//对方商人坐标
    int remoteLocationY = 0;


    int remoteCityIndex = 0; //对方帮派城市索引

    QString remoteBuyGoods; //对方帮派购买的商品，帮派之前跑商必填

    QString time; //买卖商品最高价时辰 子、丑、寅、卯

    //以下不需要持久化
    int runshopType = -1;
    QString groupBuyGoodsPrices;
    QString groupSellGoodsPrices;

    QString remoteYuyGoodsPrices;
    QString remoteSellGoodsPrices;

    QString groupBuyShopImg; //购买帮派的商品
    QString groupSellShopImg; //出售帮派的商品

    Scalar groupStartScalar; //购买 帮派商品的色域
    Scalar groupEndScalar;

    QString remoteBuyShopImg; //购买 大理、苏州、洛阳 商品的图片
    QString remoteSellShopImg; //出售 大理、苏州、洛阳 商品的图片

    Scalar remoteStartScalar; //购买 大理、苏州、洛阳 商品的图片的色域
    Scalar remoteEndScalar;



    QList<CityNode *> leaveLine;
    QList<CityNode *> backLine;

private:
    static void createObject(QJsonObject &obj, RunShopBean* runShopBean);
    void setRunshopType();

public:
    RunShopBean();

    RunShopBean(int num, QString groupCity, QString groupXiaoWeiLocation, int groupIndex,QString remoteCity,QString remoteXiaoWeiLocation,
               int remoteCityIndex, QString remoteBuyGoods, QString time);

    void setLine();

    static QList<RunShopBean> jsonToArray(QByteArray jsonArray);

    static QByteArray ArraytoJson(QList<RunShopBean*> *roleBeans);


};

#endif // RUNSHOPBEAN_H
